package services.scanner;


import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * @author sergiu.marin
 * @since 08.01.2014
 */
public class SystemScan {

    public static List<String> getRootDirectories() {
        List<String> paths = new ArrayList<>();
        File[] roots = File.listRoots();
        for (File root : roots) {
            paths.add(root.toString());
        }
        return paths;
    }

    public static List<String> getPathDirectories(String path) {
        List<String> paths = new ArrayList<>();
        File file = new File(path);
        File[] files = file.listFiles();
        if (files != null) {
            for (File f : files) {
                paths.add(f.toString());
            }
        }
        return paths;
    }
}
